package org.hentor.modules.generate.generate.dbGenerate;

import org.hentor.modules.generate.dto.GenerateDbDTO;

import java.util.List;

/**
 * ddl生成工厂类
 */
public class DbGenerateFactory {


    public static List<String> generate(GenerateDbDTO generateDbDTO) {
        AbstractDbGenerate generate;
        switch (generateDbDTO.getDbType()) {
            case MYSQL:
                generate = new MysqlGenerateDb();
                break;
            default:
                throw new RuntimeException(String.format("未找到数据库类型 %s 的生成类", generateDbDTO.getDbType()));
        }
        return generate.generate(generateDbDTO);
    }

}
